<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../jQuery.js"></script>
    <style>
        #root{
            position: absolute;
            height: 100px;
            width: 100px;
            color: skyblue;
            background-color: black;
        }
        #right{
            position: absolute;
            height: 100px;
            width: 100px;
            color: skyblue;
            background-color: black;
        }
    </style>
</head>
<body>
        <button class="left">点击div开始向左运动</button><br/><br/>
        <button class="right">点击div开始回来运动</button> 
    <div id="root">我是div</div >

    <script>
        $(function(){
            $(".left").click(function(){
                $("div").stop().animate({left:'1000px',opacity:0.8},"fast")
            })
            $(".right").click(function(){
                $("div").stop().animate({left:'-1000px',opacity:0.4}, "slow",)
            })
        })
    </script>
</body>
</html>